package com.medusa.aps.business.config;

import com.medusa.aps.business.properties.ApsProperties;
import io.swagger.v3.oas.models.OpenAPI;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: xh.yu
 * @createTime: 2023/08/24 17:10
 */
@Configuration
@ConditionalOnProperty(prefix = "aps", name = "swagger-enable", havingValue = "true")
public class OpenApiConfig {

    @Bean
    public OpenAPI springOpenAPI(ApsProperties apsProperties) {
        return new OpenAPI().info(apsProperties.getSwagger());
    }
}
